import baseApi from "@/api/declaration/baseApi"
import httpRequest from "@/config/axios/httpRequest"
import {  QueryAreaByIpResp, QueryAreaTreeResp } from "@/models/base/AreaTreeModel"

// 获得地区树
export const getAreaTree = async () => {
  return await httpRequest.get<QueryAreaTreeResp>(baseApi.QueryAreaTree)
}

// 获得 IP 对应的地区名
export const getAreaByIp = async (ip: string) => {
  return await httpRequest.get<QueryAreaByIpResp>(baseApi.QueryAreaByIp,{ params: { IP: ip } } )
}
